using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using VisualDB.Entities;

namespace VisualDB.DAL
{
    public class DALFactory
    {
        public static IDatabaseDAL GetDatabaseDAL(DatabaseEntity database)
        {
            IDatabaseDAL dal = null;

            switch (database.DatabaseType.Name)
            {
                case DatabaseType.SQLServer:
                    dal = new SQLServerDAL(database);
                    break;

                case DatabaseType.MySQL:
                    dal = new MySQLDAL(database);
                    break;
            }
            
            dal.DatabaseEntity = database;

            return dal;
        }
    }
}
